<div class="container">
  
	<form class="form-signin" role="form">
	<div id="respuesta"></div>
			<h2 class="form-signin-heading">Ingreso de Usuarios</h2><p>&nbsp;</p>
					<input type="text" name="user" id="user" class="form-control" placeholder="Usuario" required autofocus value="">
                    <input type="password" class="form-control" placeholder="Clave" required name="pass" id="pass">
					<button class="btn btn-lg btn-primary btn-block" type="submit" name="enviar" id="enviar">Enviar</button>		
			<p>&nbsp;</p>
</form>
</div>

<script>
	$("#enviar").click(function(event){
		event.preventDefault();
		var user=$("#user").val();
		var pass=$("#pass").val();
			if(user !=""){
				if (pass !=""){
					$.post("<?php echo $url1;?>",{user:user,pass:pass},function(res){
						if(res!=0){
							window.location.href="<?php echo $url2;?>";
						}
						
					});
				}
				else{
					$("#respuesta").html('<span class="error">Ingrese contrasena.</span>');
				}
				
			}else{
				$("#respuesta").html('<span class="error">Ingrese usuario.</span>');
			}
		
	});
</script>